/* @(#) somx/readme 2.3 1/20/94 09:35:52 [5/15/94 17:58:00] */

/*
 * 96F8647, 96F8648, 96F8850 (C) Copyright IBM Corp. 1992, 1994
 * All Rights Reserved
 * Licensed Materials - Property of IBM
 *
 * DISCLAIMER OF WARRANTIES.
 * The following [enclosed] code is sample code created by IBM
 * Corporation. This sample code is not part of any standard or IBM
 * product and is provided to you solely for the purpose of assisting
 * you in the development of your applications.  The code is provided
 * "AS IS". IBM MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT
 * NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
 * FOR A PARTICULAR PURPOSE, REGARDING THE FUNCTION OR PERFORMANCE OF
 * THIS CODE.  IBM shall not be liable for any damages arising out of
 * your use of the sample code, even if they have been advised of the
 * possibility of such damages.
 *
 * DISTRIBUTION.
 * This sample code can be freely distributed, copied, altered, and
 * incorporated into other software, provided that it bears the above
 * Copyright notice and DISCLAIMER intact.
 */

This directory contains the source for the sample DSOM server object
SOMPServer which is described in the toolkit documentation.  This
directory also contains a sample client program which uses the server
object and some client persistent objects.

NOTE:  Please review the README in %SOMBASE%\samples\somd for general
       information on setting up and running DSOM samples.  This
       README assumes that information.

BUILDING THE EXAMPLES
=====================

The makefile in this directory has been set up to build two dynamically
loadable libraries and one sample client application. They are:

 - sompsvr.dll

   sompsvr.dll is the dynamically loadable library which contains the
   SOMPServer server object. The code contained in this library is loaded
   by the DSOM server process (somdsvr) when started. sompsvr.lib is an
   import library for the .dll.

 - sompobj.dll

   sompobj.dll is the dynamically loadable library which contains the
   persistent object classes which are used by the DSOM client application
   included in this sample. sompobj.lib is an import library for
   the .dll file. The client application explicitly links to sompobj.lib
   while the server process dynamically loads sompobj.dll when required.

 - somptest.exe

   somptest is the DSOM client application.

NOTE:  You must modify LIBPATH to include the subdirectory where sompsvr.dll
       and sompobj.dll reside or start the DSOM daemon from this directory.

EXECUTING THE EXAMPLES
======================

Remember that the DSOM daemon, "somdd", must be started from the directory
containing the ".dll" files produced by this sample. Or, you may update
your LIBPATH environment variable to include the directory containing this
sample's ".dll" files.

The example client application is used in two ways, first to create some
persistent objects and second to restore the previously created persistent
objects.

To create the persistent objects, enter

   wmake /f makefile.wmk create

on the command line.  This will create one phoneDir object which
contains three dirEntry objects.  These objects are created in the
server process (somdsvr) which is started automatically.  The objects
in the client process are references to those in the server process.
The client then instructs the server to store the objects.  The client
finally stores the string representation of the server object in the
restxmp.cmd file.

To restore the objects created via "wmake /f makefile.wmk create", enter

   wmake /f makefile.wmk restore

on the command line. This uses the ID stored in restxmp.cmd to restore
and dump the contents of the persistent objects.

The results of the sample are displayed to standard output.

When you run "wmake /f makefile.wmk create", the client application should
produce output similar to the following:

name1 is: Roger at 555-5085
name2 is: Hari at 555-5079
name3 is: Charles at 555-5571
phonelist object ID is: SOM|0|2c09cac5-000faadd-7f-00-0100007f0000|::phoneDir|23
|534f4d5041736369693a2e5c70303030303030303a3000
name1 object ID is: SOM|0|2c09cac5-000faadd-7f-00-0100007f0000|::dirEntry|23|534
f4d5041736369693a2e5c70303030303030313a3000
name2 object ID is: SOM|0|2c09cac5-000faadd-7f-00-0100007f0000|::dirEntry|23|534
f4d5041736369693a2e5c70303030303030323a3000
name3 object ID is: SOM|0|2c09cac5-000faadd-7f-00-0100007f0000|::dirEntry|23|534
f4d5041736369693a2e5c70303030303030333a3000

Program Completed
Run "wmake /f makefile.wmk restore" to restore the objects created.

When you run "wmake /f makefile.wmk restore", the client application should
produce output similar to the following:

somptest "SOM|0|2c09cac5-000faadd-7f-00-0100007f0000|::phoneDir|23|534f4d5041736
369693a2e5c70303030303030303a3000"
name1 is: Roger at 555-5085
name2 is: Hari at 555-5079
name3 is: Charles at 555-5571
phonelist object ID is: SOM|0|2c09cac5-000faadd-7f-00-0100007f0000|::phoneDir|23
|534f4d5041736369693a2e5c70303030303030303a3000
name1 object ID is: SOM|0|2c09cac5-000faadd-7f-00-0100007f0000|::dirEntry|23|534
f4d5041736369693a2e5c70303030303030313a3000
name2 object ID is: SOM|0|2c09cac5-000faadd-7f-00-0100007f0000|::dirEntry|23|534
f4d5041736369693a2e5c70303030303030323a3000
name3 object ID is: SOM|0|2c09cac5-000faadd-7f-00-0100007f0000|::dirEntry|23|534
f4d5041736369693a2e5c70303030303030333a3000

Program Completed
